<div class="row">
    <div class="col-lg-12">
        <h2>List</h2>
        <div class="table-responsive">
            <table class="table table-hover table-striped">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>Status</th>
                        <th>Due Date</th>
                        <th>Date Submitted</th>
                        <th>Score</th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                {% for submission in submitted_exams %}
                {% if submission.is_finished == True %}
                    <tr>
                        <td>{{ submission.exam.exam_num }}</td>
                        <td>
                            <span class="badge">Complete</span>
                        </td>
                        <td>{{ submission.exam.due_date }}</td>
                        <td>{{ submission.submission_date }}</td>
                        <td>{{ submission.percent }}%</td>
                        <td>
                            <button type="button"
                                    onclick=""
                                    class="btn btn-sm btn-primary" disabled>
                                    <i class="fa fa-file"></i> Continue
                            </button>
                            <button onclick="ajax_delete_exam_submission({{ submission.exam.exam_id }});"
                                         id="del_{{ submission.exam.exam_id }}_btn"
                                       name="del_{{ submission.exam.exam_id }}_btn"
                                       type="button"
                                      class="btn btn-sm btn-danger">
                                    <i class="fa fa-minus"></i> Delete
                            </button>
                        </td>
                    </tr>
                    {% else %}
                    <tr>
                        <td>{{ submission.exam.exam_num }}</td>
                        <td>
                            <span class="badge">Incomplete</span>
                        </td>
                        <td>{{ submission.exam.due_date }}</td>
                        <td>-</td>
                        <td>-</td>
                        <td>
                            <button onclick="view_exam({{ submission.exam.exam_id }});"
                                       type="button"
                                      class="btn btn-sm btn-primary">
                                <i class="fa fa-file"></i> Begin
                            </button>
                        </td>
                    </tr>
                    {% endif %}
                    {% endfor %}
                </tbody>
            </table>
        </div><!-- /.table -->
    </div>
</div>